# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=desed
pkgver=1.2.1
pkgrel=1
pkgdesc="Demystify and debug your sed scripts, from comfort of your terminal"
url="https://github.com/SoptikHa2/desed"
arch="all"
license="GPL-3.0-or-later"
depends="sed"  # needs GNU sed
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
source="https://github.com/SoptikHa2/desed/archive/v$pkgver/desed-$pkgver.tar.gz
	Cargo.lock
	"


prepare() {
	default_prepare

	mv "$srcdir"/Cargo.lock .
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
	install -D -m644 $pkgname.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
19849bc5f4c6513ce062a78a7c59b1f7ba6b53c6c9fc18150dbf367b2fa29443044afc683a3bb9289d5dc9a2f0e57b7cc497296d8532e53fbdc6f54ec84e0add  desed-1.2.1.tar.gz
6c462dd790f337113d0d8b1e15027ce25a9d9c8d1e3981ee38fede23110328bef025478fb9437b8dd3f14fa00c21b6287c8077091783a9f875abd62f73da2c21  Cargo.lock
"
